/**
 * Copyright (c) 2010-2011 julewa.com.  
 * All rights reserved. 
 * 
 * @author Huang Benhua
 * @date 2011-2-20
 * 
**/
package com.julewa.db;

import java.util.Collection;

public interface BeanInfo {
	//
	public interface ColumnInfo{
		public Class<?> getTypeClass();
		public DataType getDataType();
		public PropertyType getPropertyType();
		public BeanInfo getPropertyBeanInfo();
		public String getCode();
		public String getLabel();
		public double getMin();
		public double getMax();
		public boolean isKey();
		public boolean isCheckMin();
		public boolean isCheckMax();
		public boolean isNullable();
		public SearchDefine getSearchDefine();
		public StringTrimmer getAutoTrimmer();
		//
		public DataState checkDataState(Object bean);
		public <T> void clone(T from, T to)throws Exception;
		public void clearRelativeFields(Object bean) throws Exception;
	}
	//
	public String getCode();
	public String getLabel();
	public boolean isEntity();
	public boolean isDynamic();
	public Class<?> getTypeClass();
	public boolean isAutowire();
	public Collection<ColumnInfo> getKeys();
	public Collection<ColumnInfo> getColumns();
	public Collection<ColumnInfo> getAllColumns();
	//
	public ColumnInfo getColumn(String column);
	
	//两个的类型必须一致
	public <T> void copy(T from, T to)throws Exception;
	public <T> void clone(T from, T to)throws Exception;
}
